package com.my.chapter7;

public class practice9 {
    public static void main(String[] args) {
        Stem s = new Stem();
    }
}

class Component1{
    public Component1(){
        System.out.println("Component1 constructor");
    }
}

class Component2{
    public Component2(){
        System.out.println("Component2 constructor");
    }
}

class Component3{
    public Component3(){
        System.out.println("Component3 constructor");
    }
}

class Root{
    private Component1 c1 =new Component1();
    private Component2 c2 =new Component2();
    private Component3 c3 =new Component3();
    public Root(){
        System.out.println("Root constructor");
    }
}

class Stem extends Root{
    public Stem(){
        System.out.println("Stem constructor");
    }
}



